import request from '@/utils/request'

// 查询采购管理列表
export function listPurchasing(query) {
  return request({
    url: '/procure/purchasing/list',
    method: 'get',
    params: query
  })
}

// 查询合作管理列表
export function listCooperate(query) {
  return request({
    url: '/procure/purchasing/listCooperate',
    method: 'get',
    params: query
  })
}

// 查询采购管理详细
export function getPurchasing(id) {
  return request({
    url: '/procure/purchasing/' + id,
    method: 'get'
  })
}

// 新增采购管理
export function addPurchasing(data) {
  return request({
    url: '/procure/purchasing',
    method: 'post',
    data: data
  })
}

// 修改采购管理
export function updatePurchasing(data) {
  return request({
    url: '/procure/purchasing',
    method: 'put',
    data: data
  })
}

export function updateCooperate(data) {
  return request({
    url: '/procure/purchasing/update',
    method: 'put',
    data: data
  })
}
// 删除采购管理
export function delPurchasing(id) {
  return request({
    url: '/procure/purchasing/' + id,
    method: 'delete'
  })
}
//修改成完结状态
export function updateStatus(id){
  return request({
    url:'/procure/purchasing/end/'+id,
    method: 'get'
  })
}
export function findLastNo(){
  return request({
    url:'/procure/purchasing/LatestNo',
    method: 'get'
  })
}
// 查询采购管理审核列表
export function listPurchasingExamine(query) {
  return request({
    url: '/procure/purchasing/listByExamine',
    method: 'get',
    params: query
  })
}

// 查询合作管理审核列表
export function listByCooperateExamine(query) {
  return request({
    url: '/procure/purchasing/listByCooperateExamine',
    method: 'get',
    params: query
  })
}

export function Approved(id){
  return request({
    url:'/procure/purchasing/Approved/'+id,
    method: 'get'
  })
}

export function repulse(id){
  return request({
    url:'/procure/purchasing/repulse/'+id,
    method: 'get'
  })
}

